<!-- HTML header for doxygen 1.8.18-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <meta name="generator" content="Doxygen 1.8.18" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Limit Order Book: include/lib_lob.hpp Source File</title>
    <link href="tabs.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="dynsections.js"></script>
    <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
    <link href="html_stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="top">
        <!-- do not remove this div, it is closed by doxygen! -->
        <div id="titlearea">
            <table cellspacing="0" cellpadding="0">
                <tbody>
                    <tr style="height: 56px;">
                        <td id="projectalign" style="padding-left: 0.5em;">
                            <div id="projectname">Limit Order Book
                                &#160;<span id="projectnumber">2.0.0</span>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">lib_lob.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">// A C level API to the framework.</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Copyright (c) 2020 Christian Kauten</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// of this software and associated documentation files (the &quot;Software&quot;), to deal</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// in the Software without restriction, including without limitation the rights</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// furnished to do so, subject to the following conditions:</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">// The above copyright notice and this permission notice shall be included in</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// all copies or substantial portions of the Software.</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">// THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXTERNRESS OR</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// SOFTWARE.</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#ifndef LOB_C_LIBRARY_HPP_</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#define LOB_C_LIBRARY_HPP_</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;limit_order_book.hpp&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160; </div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">// Windows-base systems</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#if defined(_WIN32)       || \</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">    defined(WIN32)        || \</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">    defined(__CYGWIN__)   || \</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">    defined(__MINGW32__)  || \</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">    defined(__BORLANDC__)</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <span class="comment">// setup the module initializer. required to link visual studio C++ ctypes</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    <span class="keywordtype">void</span> PyInit_lib_limit_order_book() { }</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="comment">// setup the function modifier to export in the DLL</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">    #define EXTERN __declspec(dllexport)</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="comment">// Unix-like systems</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <span class="comment">// setup the modifier as a dummy</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">    #define EXTERN</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    EXTERN <a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* new_() { <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>(); }</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    EXTERN <span class="keywordtype">void</span> delete_(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book) { <span class="keyword">delete</span> book; }</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    EXTERN <span class="keywordtype">void</span> clear(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book) { book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a25db4d825c1f8504e8be5dae532dbb87">clear</a>(); }</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160; </div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    EXTERN <span class="keywordtype">void</span> limit_sell(</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        <a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book,</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        <a class="code" href="namespace_l_o_b.html#a482ac950a9cb23fdb93c66d6117a8f74">LOB::UID</a> uid,</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        <a class="code" href="namespace_l_o_b.html#a1d5eee8595d35bc6f2b8372e44cd8dd7">LOB::Quantity</a> quantity,</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <a class="code" href="namespace_l_o_b.html#a0170482547b909e8a53b5ae42d18e23a">LOB::Price</a> price</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    ) { book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a5c93f74cfed393b21ef5b88787b95b79">limit_sell</a>(uid, quantity, price); }</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    EXTERN <span class="keywordtype">void</span> limit_buy(</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        <a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book,</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <a class="code" href="namespace_l_o_b.html#a482ac950a9cb23fdb93c66d6117a8f74">LOB::UID</a> uid,</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        <a class="code" href="namespace_l_o_b.html#a1d5eee8595d35bc6f2b8372e44cd8dd7">LOB::Quantity</a> quantity,</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        <a class="code" href="namespace_l_o_b.html#a0170482547b909e8a53b5ae42d18e23a">LOB::Price</a> price</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    ) { book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a1fc2e7e8d44b57c21be04aea96a208ef">limit_buy</a>(uid, quantity, price); }</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    EXTERN <span class="keywordtype">void</span> limit(</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        <a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book,</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        <a class="code" href="namespace_l_o_b.html#ac0757a974349160aa795b45451948db6">LOB::Side</a> side,</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        <a class="code" href="namespace_l_o_b.html#a482ac950a9cb23fdb93c66d6117a8f74">LOB::UID</a> uid,</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;        <a class="code" href="namespace_l_o_b.html#a1d5eee8595d35bc6f2b8372e44cd8dd7">LOB::Quantity</a> quantity,</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        <a class="code" href="namespace_l_o_b.html#a0170482547b909e8a53b5ae42d18e23a">LOB::Price</a> price</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    ) { book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a0701f5738fba67af36a47983c38dd9c1">limit</a>(side, uid, quantity, price); }</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    EXTERN <span class="keywordtype">bool</span> has(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book, <a class="code" href="namespace_l_o_b.html#a482ac950a9cb23fdb93c66d6117a8f74">LOB::UID</a> uid) {</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a967430745df666a98b00d169bf14cee3">has</a>(uid);</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    }</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160; </div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    EXTERN <span class="keyword">const</span> <a class="code" href="struct_l_o_b_1_1_order.html">LOB::Order</a>* get(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book, <a class="code" href="namespace_l_o_b.html#a482ac950a9cb23fdb93c66d6117a8f74">LOB::UID</a> uid) {</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        <span class="keywordflow">return</span> &amp;book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a47a0fe3f7ac4da1b6ce80e0902ef0473">get</a>(uid);</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    }</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160; </div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    EXTERN <span class="keywordtype">void</span> cancel(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book, <a class="code" href="namespace_l_o_b.html#a482ac950a9cb23fdb93c66d6117a8f74">LOB::UID</a> uid) {</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#af94adea77f7dad19b4dd061d69a96d91">cancel</a>(uid);</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    }</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160; </div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    EXTERN <span class="keywordtype">void</span> market_sell(</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;        <a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book,</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        <a class="code" href="namespace_l_o_b.html#a482ac950a9cb23fdb93c66d6117a8f74">LOB::UID</a> uid,</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        <a class="code" href="namespace_l_o_b.html#a1d5eee8595d35bc6f2b8372e44cd8dd7">LOB::Quantity</a> quantity</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    ) { book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#abc553a89a69dba889a5d338645376dce">market_sell</a>(uid, quantity); }</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160; </div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    EXTERN <span class="keywordtype">void</span> market_buy(</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;        <a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book,</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        <a class="code" href="namespace_l_o_b.html#a482ac950a9cb23fdb93c66d6117a8f74">LOB::UID</a> uid,</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;        <a class="code" href="namespace_l_o_b.html#a1d5eee8595d35bc6f2b8372e44cd8dd7">LOB::Quantity</a> quantity</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    ) { book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a64a58b51c467ef7ffcf97d806f5282ca">market_buy</a>(uid, quantity); }</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160; </div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    EXTERN <span class="keywordtype">void</span> market(</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        <a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book,</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;        <a class="code" href="namespace_l_o_b.html#ac0757a974349160aa795b45451948db6">LOB::Side</a> side,</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        <a class="code" href="namespace_l_o_b.html#a482ac950a9cb23fdb93c66d6117a8f74">LOB::UID</a> uid,</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;        <a class="code" href="namespace_l_o_b.html#a1d5eee8595d35bc6f2b8372e44cd8dd7">LOB::Quantity</a> quantity</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    ) { book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a1c7a81804946e116e376c550154a092d">market</a>(side, uid, quantity); }</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160; </div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    EXTERN <a class="code" href="namespace_l_o_b.html#a0170482547b909e8a53b5ae42d18e23a">LOB::Price</a> best_sell(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book) {</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;        <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#afd8dd7bccdcffee233c780fe445e1c01">best_sell</a>();</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    }</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160; </div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    EXTERN <a class="code" href="namespace_l_o_b.html#a0170482547b909e8a53b5ae42d18e23a">LOB::Price</a> best_buy(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book) {</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a7b2ad9b29403af9a5079176aefb009ce">best_buy</a>();</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    }</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160; </div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    EXTERN <a class="code" href="namespace_l_o_b.html#a0170482547b909e8a53b5ae42d18e23a">LOB::Price</a> best(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book, <a class="code" href="namespace_l_o_b.html#ac0757a974349160aa795b45451948db6">LOB::Side</a> side) {</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;        <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a387f091324bb052d38c8532ab508ab7c">best</a>(side);</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    }</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160; </div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    EXTERN <a class="code" href="namespace_l_o_b.html#a0860e916768a8e3baaadf73c1a6f9c58">LOB::Volume</a> volume_sell_price(</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;        <a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book,</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;        <a class="code" href="namespace_l_o_b.html#a0170482547b909e8a53b5ae42d18e23a">LOB::Price</a> price</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    ) { <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#aa767c4ecce229b3393159ffd1cf481bb">volume_sell</a>(price); }</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160; </div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    EXTERN <a class="code" href="namespace_l_o_b.html#a0860e916768a8e3baaadf73c1a6f9c58">LOB::Volume</a> volume_sell(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book) {</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;        <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#aa767c4ecce229b3393159ffd1cf481bb">volume_sell</a>();</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    }</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160; </div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    EXTERN <a class="code" href="namespace_l_o_b.html#a0860e916768a8e3baaadf73c1a6f9c58">LOB::Volume</a> volume_buy_price(</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;        <a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book,</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;        <a class="code" href="namespace_l_o_b.html#a0170482547b909e8a53b5ae42d18e23a">LOB::Price</a> price</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;    ) { <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a7d1612e63e88d3dc75046d3d653f1312">volume_buy</a>(price); }</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160; </div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    EXTERN <a class="code" href="namespace_l_o_b.html#a0860e916768a8e3baaadf73c1a6f9c58">LOB::Volume</a> volume_buy(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book) {</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;        <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a7d1612e63e88d3dc75046d3d653f1312">volume_buy</a>();</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    }</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160; </div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    EXTERN <a class="code" href="namespace_l_o_b.html#a0860e916768a8e3baaadf73c1a6f9c58">LOB::Volume</a> volume_price(</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;        <a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book,</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;        <a class="code" href="namespace_l_o_b.html#a0170482547b909e8a53b5ae42d18e23a">LOB::Price</a> price</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    ) { <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#ac9b18049862c09ce70c87d679a83bd9f">volume</a>(price); }</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160; </div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;    EXTERN <a class="code" href="namespace_l_o_b.html#a0860e916768a8e3baaadf73c1a6f9c58">LOB::Volume</a> volume(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book) {</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;        <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#ac9b18049862c09ce70c87d679a83bd9f">volume</a>();</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;    }</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160; </div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;    EXTERN <a class="code" href="namespace_l_o_b.html#a98c8cdadc7da7cd760e1a6dede850854">LOB::Count</a> count_at(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book, <a class="code" href="namespace_l_o_b.html#a0170482547b909e8a53b5ae42d18e23a">LOB::Price</a> price) {</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;        <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a467bc9491b867ec41ae85a1b93953717">count_at</a>(price);</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    }</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160; </div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    EXTERN <a class="code" href="namespace_l_o_b.html#a98c8cdadc7da7cd760e1a6dede850854">LOB::Count</a> count_sell(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book) {</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;        <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a3f67e339651390feb7171cea1bbd5c91">count_sell</a>();</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    }</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160; </div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;    EXTERN <a class="code" href="namespace_l_o_b.html#a98c8cdadc7da7cd760e1a6dede850854">LOB::Count</a> count_buy(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book) {</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;        <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a7b32433cbe16525043683dd76b5eebc4">count_buy</a>();</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    }</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160; </div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    EXTERN <a class="code" href="namespace_l_o_b.html#a98c8cdadc7da7cd760e1a6dede850854">LOB::Count</a> count(<a class="code" href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a>* book) {</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;        <span class="keywordflow">return</span> book-&gt;<a class="code" href="class_l_o_b_1_1_limit_order_book.html#a13a16e7cee3c24cf0d80b84440d7f7ac">count</a>();</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;    }</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;}</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160; </div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;<span class="comment">// un-define the export macro</span></div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;<span class="preprocessor">#undef EXTERN</span></div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160; </div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;<span class="preprocessor">#endif  // LOB_C_LIBRARY_HPP_</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a1fc2e7e8d44b57c21be04aea96a208ef"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a1fc2e7e8d44b57c21be04aea96a208ef">LOB::LimitOrderBook::limit_buy</a></div><div class="ttdeci">void limit_buy(UID order_id, Quantity quantity, Price price)</div><div class="ttdoc">Add a new buy limit order to the book.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:92</div></div>
<div class="ttc" id="anamespace_l_o_b_html_ac0757a974349160aa795b45451948db6"><div class="ttname"><a href="namespace_l_o_b.html#ac0757a974349160aa795b45451948db6">LOB::Side</a></div><div class="ttdeci">Side</div><div class="ttdoc">the possible sides for the LimitTree</div><div class="ttdef"><b>Definition:</b> structures.hpp:35</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a47a0fe3f7ac4da1b6ce80e0902ef0473"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a47a0fe3f7ac4da1b6ce80e0902ef0473">LOB::LimitOrderBook::get</a></div><div class="ttdeci">const Order &amp; get(UID order_id)</div><div class="ttdoc">Get the order with given ID.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:135</div></div>
<div class="ttc" id="anamespace_l_o_b_html_a482ac950a9cb23fdb93c66d6117a8f74"><div class="ttname"><a href="namespace_l_o_b.html#a482ac950a9cb23fdb93c66d6117a8f74">LOB::UID</a></div><div class="ttdeci">uint64_t UID</div><div class="ttdoc">a type for order IDs</div><div class="ttdef"><b>Definition:</b> structures.hpp:47</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a25db4d825c1f8504e8be5dae532dbb87"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a25db4d825c1f8504e8be5dae532dbb87">LOB::LimitOrderBook::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdoc">Clear all the orders in the book.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:57</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a387f091324bb052d38c8532ab508ab7c"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a387f091324bb052d38c8532ab508ab7c">LOB::LimitOrderBook::best</a></div><div class="ttdeci">Price best(Side side) const</div><div class="ttdoc">Return the best price for the given side.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:238</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a7b2ad9b29403af9a5079176aefb009ce"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a7b2ad9b29403af9a5079176aefb009ce">LOB::LimitOrderBook::best_buy</a></div><div class="ttdeci">Price best_buy() const</div><div class="ttdoc">Return the best buy price.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:227</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a13a16e7cee3c24cf0d80b84440d7f7ac"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a13a16e7cee3c24cf0d80b84440d7f7ac">LOB::LimitOrderBook::count</a></div><div class="ttdeci">Count count() const</div><div class="ttdoc">Return the total number of orders in the book.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:380</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a7b32433cbe16525043683dd76b5eebc4"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a7b32433cbe16525043683dd76b5eebc4">LOB::LimitOrderBook::count_buy</a></div><div class="ttdeci">Count count_buy() const</div><div class="ttdoc">Return the total number of orders on the buy side of the book.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:374</div></div>
<div class="ttc" id="anamespace_l_o_b_html_a0860e916768a8e3baaadf73c1a6f9c58"><div class="ttname"><a href="namespace_l_o_b.html#a0860e916768a8e3baaadf73c1a6f9c58">LOB::Volume</a></div><div class="ttdeci">uint64_t Volume</div><div class="ttdoc">a type for limit total volume</div><div class="ttdef"><b>Definition:</b> structures.hpp:90</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a467bc9491b867ec41ae85a1b93953717"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a467bc9491b867ec41ae85a1b93953717">LOB::LimitOrderBook::count_at</a></div><div class="ttdeci">Count count_at(Price price) const</div><div class="ttdoc">Return the total number of orders at the given limit price.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:360</div></div>
<div class="ttc" id="astruct_l_o_b_1_1_order_html"><div class="ttname"><a href="struct_l_o_b_1_1_order.html">LOB::Order</a></div><div class="ttdoc">A single order in the LimitOrderBook.</div><div class="ttdef"><b>Definition:</b> structures.hpp:57</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a7d1612e63e88d3dc75046d3d653f1312"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a7d1612e63e88d3dc75046d3d653f1312">LOB::LimitOrderBook::volume_buy</a></div><div class="ttdeci">Volume volume_buy(Price price) const</div><div class="ttdoc">Return the total volume for the buy side of the book.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:321</div></div>
<div class="ttc" id="anamespace_l_o_b_html_a98c8cdadc7da7cd760e1a6dede850854"><div class="ttname"><a href="namespace_l_o_b.html#a98c8cdadc7da7cd760e1a6dede850854">LOB::Count</a></div><div class="ttdeci">uint32_t Count</div><div class="ttdoc">a type for limit price order counts</div><div class="ttdef"><b>Definition:</b> structures.hpp:88</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a967430745df666a98b00d169bf14cee3"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a967430745df666a98b00d169bf14cee3">LOB::LimitOrderBook::has</a></div><div class="ttdeci">bool has(UID order_id) const</div><div class="ttdoc">Return true if the book has an order with given ID, false otherwise.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:128</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a0701f5738fba67af36a47983c38dd9c1"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a0701f5738fba67af36a47983c38dd9c1">LOB::LimitOrderBook::limit</a></div><div class="ttdeci">void limit(Side side, UID order_id, Quantity quantity, Price price)</div><div class="ttdoc">Add a new order to the book.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:116</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a1c7a81804946e116e376c550154a092d"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a1c7a81804946e116e376c550154a092d">LOB::LimitOrderBook::market</a></div><div class="ttdeci">void market(Side side, UID order_id, Quantity quantity)</div><div class="ttdoc">Execute a market order.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:206</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a64a58b51c467ef7ffcf97d806f5282ca"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a64a58b51c467ef7ffcf97d806f5282ca">LOB::LimitOrderBook::market_buy</a></div><div class="ttdeci">void market_buy(UID order_id, Quantity quantity)</div><div class="ttdoc">Execute a buy market order.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:195</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_af94adea77f7dad19b4dd061d69a96d91"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#af94adea77f7dad19b4dd061d69a96d91">LOB::LimitOrderBook::cancel</a></div><div class="ttdeci">void cancel(UID order_id)</div><div class="ttdoc">Cancel an existing order in the book.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:141</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html">LOB::LimitOrderBook</a></div><div class="ttdoc">An order book for managing Limit / Order objects in a continuous double auction.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:43</div></div>
<div class="ttc" id="anamespace_l_o_b_html_a1d5eee8595d35bc6f2b8372e44cd8dd7"><div class="ttname"><a href="namespace_l_o_b.html#a1d5eee8595d35bc6f2b8372e44cd8dd7">LOB::Quantity</a></div><div class="ttdeci">uint32_t Quantity</div><div class="ttdoc">a type for order quantities</div><div class="ttdef"><b>Definition:</b> structures.hpp:49</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_abc553a89a69dba889a5d338645376dce"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#abc553a89a69dba889a5d338645376dce">LOB::LimitOrderBook::market_sell</a></div><div class="ttdeci">void market_sell(UID order_id, Quantity quantity)</div><div class="ttdoc">Execute a sell market order.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:185</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_ac9b18049862c09ce70c87d679a83bd9f"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#ac9b18049862c09ce70c87d679a83bd9f">LOB::LimitOrderBook::volume</a></div><div class="ttdeci">Volume volume(Price price) const</div><div class="ttdoc">Return the volume at the given limit price.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:345</div></div>
<div class="ttc" id="anamespace_l_o_b_html_a0170482547b909e8a53b5ae42d18e23a"><div class="ttname"><a href="namespace_l_o_b.html#a0170482547b909e8a53b5ae42d18e23a">LOB::Price</a></div><div class="ttdeci">uint64_t Price</div><div class="ttdoc">a type for order prices</div><div class="ttdef"><b>Definition:</b> structures.hpp:51</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a3f67e339651390feb7171cea1bbd5c91"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a3f67e339651390feb7171cea1bbd5c91">LOB::LimitOrderBook::count_sell</a></div><div class="ttdeci">Count count_sell() const</div><div class="ttdoc">Return the total number of orders on the sell side of the book.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:368</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_aa767c4ecce229b3393159ffd1cf481bb"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#aa767c4ecce229b3393159ffd1cf481bb">LOB::LimitOrderBook::volume_sell</a></div><div class="ttdeci">Volume volume_sell(Price price) const</div><div class="ttdoc">Return the total volume for the sell side of the book.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:297</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_a5c93f74cfed393b21ef5b88787b95b79"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#a5c93f74cfed393b21ef5b88787b95b79">LOB::LimitOrderBook::limit_sell</a></div><div class="ttdeci">void limit_sell(UID order_id, Quantity quantity, Price price)</div><div class="ttdoc">Add a new sell limit order to the book.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:69</div></div>
<div class="ttc" id="aclass_l_o_b_1_1_limit_order_book_html_afd8dd7bccdcffee233c780fe445e1c01"><div class="ttname"><a href="class_l_o_b_1_1_limit_order_book.html#afd8dd7bccdcffee233c780fe445e1c01">LOB::LimitOrderBook::best_sell</a></div><div class="ttdeci">Price best_sell() const</div><div class="ttdoc">Return the best sell price.</div><div class="ttdef"><b>Definition:</b> limit_order_book.hpp:217</div></div>
<!-- HTML footer for doxygen 1.8.18-->
<!-- start footer part -->
</body>
</html>
